﻿using System;
using System.Data;
using System.Web;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
using Microsoft.ApplicationBlocks.Data;
namespace AnyOffice.general.system.workflow.flow_type
{
    public partial class type_list : ModulePage
    {
   
        public int FlowNums(int flowId)
        {
            string commandText = "SELECT COUNT(*) FROM [dbo].[Flow_Run] WHERE [FlowId] = " + flowId.ToString();
            object obj2 = SqlHelper.ExecuteScalar(base.Conn, CommandType.Text, commandText);
            if (obj2 != null)
            {
                return Convert.ToInt32(obj2);
            }
            return 0;
        }
      

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                int num = (Request.QueryString["sort_id"] == null) ? 0 : int.Parse(Request.QueryString["sort_id"].ToString());
                this.ViewState["SortId"] = num;
                DataTable table = new FlowSortDao().SelectBySortId(base.Conn, num);
                if (table.Rows.Count > 0)
                {
                    this.litSortName.Text = table.Rows[0]["SortName"].ToString();
                }
                DataTable table2 = new FlowTypeDao().SelectByFlowSort(base.Conn, num);
                if (table2.Rows.Count > 0)
                {
                    this.rptFlowType.DataSource = table2;
                    this.rptFlowType.DataBind();
                }
                else
                {
                    this.litMessage.Text = base.ShowMessage("无相关流程");
                }
            }
        }
      
    }
}

